<%@ include file="/basecore/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title> WitApplication AdminCentral  </title>
    <%@ include file="/basecore/meta.jsp"%>	
    <link rel="shortcut icon" href="/.resources/admin-images/favicon.ico"  type="image/x-icon" />
    <link rel="stylesheet" type="text/css" href="/baseapplication/webresource/css/admin-css/admin-all.css" />
    <!--  keep the old javascripts -->
    <script type="text/javascript" src="/baseapplication/webresource/js/javascript.js"><!-- --></script>
    <script type="text/javascript" src="/baseapplication/webresource/js/messages.en.js"><!-- --></script>
    <script type="text/javascript">
        importClass("mgnl.admininterface.AdminCentral");
        importClass("mgnl.admininterface.Navigation");
        var mgnlNavigation;
        var mgnlAdminCentral;
        function configureNavigation() {
            mgnlNavigation.addNode ("1", "首页", "MgnlAdminCentral.showContent('/index.jsp')", contextPath + "/webresource/images/ad/earth.gif");
					
			mgnlNavigation.addNode ("2", "安全", "", contextPath + "/webresource/images/ad/key1.gif");
			mgnlNavigation.getNode("2").addNode ("2001", "用户", "MgnlAdminCentral.showContent('"+contextPath+"/userController.wit')", contextPath + "/webresource/images/ad/pawn_glass_yellow.gif");
			mgnlNavigation.getNode("2").addNode ("2002", "System Users", "MgnlAdminCentral.showContent('users')", contextPath + "/webresource/images/ad/pawn_glass_yellow.gif");
			mgnlNavigation.getNode("2").addNode ("2003", "组", "MgnlAdminCentral.showContent('usergroups')", contextPath + "/webresource/images/ad/group.gif");
			mgnlNavigation.getNode("2").addNode ("2004", "角色", "MgnlAdminCentral.showContent('"+contextPath+"/roleController.wit')", contextPath + "/webresource/images/ad/hat_white.gif");
			
	    }
        // init the system
        onload = function() {
            // start the admin central
            mgnlAdminCentral = new MgnlAdminCentral();
            // create and configure the navigation
            mgnlNavigation = new MgnlNavigation();
            configureNavigation();
            // init navigation
            mgnlNavigation.create('mgnlAdminCentralMenuInnerDiv');
            // call the onload method
            try {
                if (opener &&  opener.MgnlAdminCentral && opener.MgnlAdminCentral.onOpenedInNewWindow) {
                    opener.MgnlAdminCentral.onOpenedInNewWindow(mgnlAdminCentral);
                }
                else {
                    // call the frist menupoint with a link
                    mgnlNavigation.activate('1', true);
                }
            } catch(e) {
                // Permission denied to get property Window.MgnlAdminCentral
                mgnlNavigation.activate('1', true);
            }
            // resize
            mgnlAdminCentral.resize();
            mgnlAdminCentral.setMessage("<b\>","messageBoxError");

            // on resize
            onresize = function() {
                mgnlAdminCentral.resize()
            };
        }
    </script>
  </head>
  <body id="mgnl" class="mgnlBgDark mgnlAdminMain">
    <!-- logo -->
    <div>
    <a href="#" target="_blank">
      <img style="position:absolute; top:17px; left:20px" alt="witframework"  src="${contextPath}/webresource/images/logo.PNG"/>      
    </a>
    </div>
    <!--  user info -->
    <div style="position:absolute;top:34px;right:20px;text-align:right;" class="mgnlText">
      <form action="${contextPath}/logoutController.wit" method="post" style="padding: 0; margin: 0;">
        <div>
        <input type="hidden" name="mgnlLogout" value="true"/>
        User: 
          <span onclick="mgnlOpenDialog('/system/superuser','','','','users','.magnolia/dialogs/userpreferences.html')" 
          	style=" font-size: 11px; color: black; border: 0; background: transparent; outline: invert none 0; cursor: pointer; padding: 0; margin: 0;"
			onmouseover="this.style.textDecoration = 'underline';" onmouseout="this.style.textDecoration = 'none';">
			<%=new com.witframework.core.WitFrameWork().getContext().getUserName()%>
		  </span>         |
        <input type="submit" name="logout" value="Logout" style="font-size: 11px; border: 0; background: transparent; outline: invert none 0; cursor: pointer; padding: 0; margin: 0:" onmouseover="this.style.textDecoration = 'underline';" onmouseout="this.style.textDecoration = 'none';"/>
        </div>
      </form>
    </div>
    <!-- Menu -->
    <div id="mgnlAdminCentralMenuDiv" class="mgnlAdminCentralMenuDiv">
      <div id="mgnlAdminCentralMenuInnerDiv" style="position: absolute;">
        <!-- do not delete me -->
      </div>
      <div id="mgnlAdminCentralMessageBoxDiv">
        <!-- do not delete me -->
      </div>
    </div>

    <!-- Not scrolled content like the website tree -->
    <div id="mgnlAdminCentralContentDiv" class="mgnlAdminCentralContentDiv">
      <iframe id="mgnlAdminCentralContentIFrame" src="" scrolling="no" style="border: none; width:100%; height:100%"
        frameborder="0">
      </iframe>
    </div>
    <!-- Scrolled content like the about or other included pages -->
    <div id="mgnlAdminCentralScrolledContentDiv" class="mgnlAdminCentralContentDiv">
      <iframe id="mgnlAdminCentralScrolledContentIFrame" src="" style="border: none; width:100%; height:100%"
        frameborder="0">
      </iframe>
    </div>
    <!-- About -->
    <div id="mgnlAdminCentralFooterDiv" style="position:absolute;text-align:center;" class="mgnlTextSmall">
      <a href="#" target="_blank">Demo</a> &trade; witframework- <a href="#" target="_blank">Bug/feature request</a> -
      <a href="#" target="_blank">Documentation</a>
    </div>
  </body>
</html>
